package com.kye.express.business.deposit.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.kye.base.utils.DateUtils;

import java.util.Date;

/**
 * 预存运费-消费记录 日期选择器 Model
 * <p>
 * Created by SkyYu on 2018/1/24
 */
public class DepositConsumptionDateModel implements Parcelable {

    public String dateFrom;
    public String dateTo;

    public static DepositConsumptionDateModel newInstance() {
        DepositConsumptionDateModel data = new DepositConsumptionDateModel();
        data.setDateFrom(DateUtils.getDateStringByDateYearMonthDay(new Date()));
        data.setDateTo(DateUtils.getDateStringByDateYearMonthDay(new Date()));
        return data;
    }

    public String getDateFrom() {
        return dateFrom;
    }

    public void setDateFrom(String dateFrom) {
        this.dateFrom = dateFrom;
    }

    public String getDateTo() {
        return dateTo;
    }

    public void setDateTo(String dateTo) {
        this.dateTo = dateTo;
    }

    public DepositConsumptionDateModel() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.dateFrom);
        dest.writeString(this.dateTo);
    }

    private DepositConsumptionDateModel(Parcel in) {
        this.dateFrom = in.readString();
        this.dateTo = in.readString();
    }

    public static final Creator<DepositConsumptionDateModel> CREATOR = new Creator<DepositConsumptionDateModel>() {
        @Override
        public DepositConsumptionDateModel createFromParcel(Parcel source) {
            return new DepositConsumptionDateModel(source);
        }

        @Override
        public DepositConsumptionDateModel[] newArray(int size) {
            return new DepositConsumptionDateModel[size];
        }
    };
}